﻿//using System;
//using System.Collections.Generic;
//using System.Linq;
//using System.Text;
//using DynaSpace.Entity;
//using Microsoft.Xna.Framework.Graphics;
//using Microsoft.Xna.Framework.Content;
//using Microsoft.Xna.Framework;

//namespace DynaSpace.Game1
//{
//    public class ExplosionEntity : UpdatableEntity, IRendeable 
//    {
//        private static Texture2D texture;
//        private const int FRAMESCOUNT = 5; // pocet snimku animace
//        private const double EXPLOSIONLEN = 0.25; // delka trvani animace exploze
//        private double secondsToHide = EXPLOSIONLEN;
//        private bool isOldEntityDeleted = false;
//        private EntityBase oldEntity;

//        public ExplosionEntity()
//            : base()
//        {
//        }

//        public ExplosionEntity(Playground p, EntityBase oldEntity)
//            : base(p,oldEntity.Position)
//        {
//            this.oldEntity = oldEntity;
//        }



//        public override void Update(GameTime gameTime)
//        {
//            if (secondsToHide <= 0)
//                return;

//            if (!isOldEntityDeleted)
//            {
//                oldEntity.Delete();
//                isOldEntityDeleted = true;
//            }

//            secondsToHide -= gameTime.ElapsedGameTime.TotalSeconds;


//            if (secondsToHide < 0)
//            {
//                this.Delete();
//                secondsToHide = 0;
//            }
//        }

//        #region IRendeable Members

//        public void Render(Vector2 rel, SpriteBatch sb)
//        {
//            int animPhase = (int)(FRAMESCOUNT - secondsToHide * FRAMESCOUNT / EXPLOSIONLEN);
//            Rectangle srcRect = new Rectangle(animPhase * (int)SIZEX, 0, (int)SIZEX, (int)SIZEY);
//            sb.Draw(texture, (Position - rel) * SIZE,srcRect,Color.White);
//        }

//        #endregion
//    }
//}
